package edu.ubbcs.rs.backend.service.filter;

import edu.ubbcs.rs.backend.model.room.Room;
import java.util.Date;
import java.util.List;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:43
 */
public class DateFilter implements Filter<Date> {

    private Date filterValue;

    public DateFilter() {
    }

    @Override
    public void filter(List<Room> rooms) {
        System.out.println("DateFilter: " + filterValue);
//        if (filterValue != null) {
//            Iterator<Room> i = rooms.iterator();
//            while (i.hasNext()) {
//                Room room = i.next();
//                boolean containsFilterValue = false;
//                for (Reservation reservation : room.getReservations()) {
//                    if (reservation.getDate().equals(filterValue)) {
//                        containsFilterValue = true;
//                    }
//                }
//                if (!containsFilterValue) {
//                    i.remove();
//                }
//            }
//        }
    }

    @Override
    public void setFilterValue(Date filter) {
        this.filterValue = filter;
    }

    @Override
    public Date getFilterValue() {
        return filterValue;
    }
}
